import router from '@system.router';
export default {
    data: {
            timecur:'',
            rightNum:0,
            wrongNum:0,
            rate:0
    },
    onInit(){
        //获得当前时间
        var time=new Date();
        this.timecur=time.getFullYear()+"/"+(time.getMonth()+1)+"/"+time.getDate()+"   "+time.toLocaleTimeString();
        //获得答题正确率
        this.rightNum=this.$app.$def.globalData.rightNum;
        this.wrongNum=this.$app.$def.globalData.wrongNum;
        if(this.rightNum+this.wrongNum!=0){
            this.rate=this.rightNum/(this.rightNum+this.wrongNum)*100;
        }else{
            this.rate=0;
        }

    },
    done(){
        router.push({
            uri:'pages/firstpage/firstpage'
        })
    }

}
